<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function Aa(name) {
            console.log("this", this);
            this.name = name;
        }
        Aa.prototype.run = function () {
            console.log("Aa的run函数被调用了");

        }
        function Bb(name1) {
            Aa(name1); // 作为普通函数调用 window.Aa（name1）
            // 在调用函数Aa 时 更改函数内this的指向为当前构造函数所创建的实例对象this
        }
        //var b = new Bb("lili");
        //console.log(b);
        Bb.prototype = Object.create(Aa.prototype);
        var b = new Bb("lili");
        console.log(b.num);
    </script>
</body>

</html>